/******************************************************************************
 * Filename : uc_string.h
 * Copyright:
 * Created  : 2011-1-6 by franco.yin
 * Description -
 *
 ******************************************************************************/

#ifndef _UC_STRING_H
#define _UC_STRING_H

#ifdef __cplusplus
extern "C" {
#endif

#include "uc_public.h"

extern int ucstr_byte_to_str(char* pSrc, int nSrcLen, char *pDst);
extern int ucstr_str_to_byte(char* pSrc, int nSrcLen, char* pDst);
extern int ucstr_strcasecmp(const char *s1, const char *s2);
extern int ucstr_strncasecmp(const char *s1, const char *s2, int n);
extern char *ucstr_strcasestr(const char *s, const char *find);
extern char *ucstr_strcasechr(const char* s1,const char c2);
extern int ucstr_str_match(char *src_str, char *dst_str);
extern void ucstr_set_flag(UC_U8 *src, int bit, int flag);
extern int ucstr_get_flag(UC_U8 *src, int bit);
extern int ucstr_divide_fun(char *pSrc, char *pKey, int(*pFun)(int str_index, char *pStr, void *p1, void *p2), void *p1, void *p2);
extern UC_U8 *ucstr_memmem(const UC_U8 *haystack, int haystack_len, const UC_U8 *needle, int needle_len);
#define ucstr_trim(str) ucstr_trim_to(str, str, -1)
extern int ucstr_trim_to(char *dst, char *src, int max_dst_len);
extern UC_U32 ucstr_hash_key(char *str);
extern char *ucstr_replace(char *src, char *key, char *replace_as);
extern char *ucstr_get_line(char *p_start, char *p_end, char *line_buf, int buf_len);
extern int ucstr_path_fmt(char *src, int head, int tail);

#ifdef __cplusplus
}
#endif

#endif
